﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using scomA3proj;
using System.Text;

namespace scom_a3_web.jonathan_svc
{
    public partial class stockDaysCompare_test : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_Submit_Click(object sender, EventArgs e)
        {
            //do stuff string[] stockDaysCompare(List<StockInfo> stockInfo)
            List<StockInfo> myList = new List<StockInfo>();
            StringBuilder sb = new StringBuilder();
            
            StockInfo mon = new StockInfo(new DateTime(2012, 3, 5), Convert.ToDecimal(txt_Monday.Text));
            myList.Add(mon);
            StockInfo tue = new StockInfo(new DateTime(2012,3, 6), Convert.ToDecimal(txt_Tuesday.Text));
            myList.Add(tue);
            StockInfo wed = new StockInfo(new DateTime(2012,3, 7), Convert.ToDecimal(txt_Wednesday.Text));
            myList.Add(wed);
            StockInfo thur = new StockInfo(new DateTime(2012, 3, 8), Convert.ToDecimal(txt_Thursday.Text));
            myList.Add(thur);
            StockInfo fri = new StockInfo(new DateTime(2012, 3, 9), Convert.ToDecimal(txtFriday.Text));
            myList.Add(fri);
            StockInfo sat = new StockInfo(new DateTime(2012, 3, 10), Convert.ToDecimal(txt_Saturday.Text));
            myList.Add(sat);

            ServiceReference3.RequiredServices_JStanleyClient client = new ServiceReference3.RequiredServices_JStanleyClient();
            string[] outputArray = client.stockDaysCompare(myList.ToArray());
            

            //print string array
            foreach (string s in outputArray)
            {
                sb.Append(s + "<br />");
            }
            lbl_Output.Text = sb.ToString();
        }

        protected void TextBox1_TextChanged(object sender, EventArgs e)
        {

        }

    }
}